import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/login.vue'
import Home from '@/views/Home.vue'
import User from '@/views/user/User.vue'
import Roles from '@/views/rights/roles.vue'
import Rights from '@/views/rights/rights.vue'
import Goods from '@/views/goods/Goods.vue'
import Params from '@/views/goods/Params.vue'
import Categories from '@/views/goods/Categories.vue'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    // name: 'HelloWorld',
    // component: HelloWorld,
    redirect: {name: 'Login'}
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: {name: 'User'},
    children: [
      {name: 'User', path: 'users', component: User},
      {name: 'Roles', path: 'roles', component: Roles},
      {name: 'Rights', path: 'rights', component: Rights},
      {name: 'Goods', path: 'goods', component: Goods},
      {name: 'Params', path: 'params', component: Params},
      {name: 'Categories', path: 'categories', component: Categories}
    ]
  }
  ]
})
